package com.lyf.design.learn.designmodel.singleton;

/**
 * @AUTHOR LYF
 * @DATE 2022/6/1
 * @VERSION 1.0
 * @DESC
 * 饿汉式——双重锁
 */
public class Main6 {
    private static  volatile Main6 INSTANCE;//new Main4();
    private Main6(){}
    static Main6 getInstance(){
        if(INSTANCE==null){
            synchronized(Main5.class){
                if(INSTANCE==null)
                    INSTANCE = new Main6();
            }
        }
        return INSTANCE;
    }
    void method(){}
}
